Hi all,
/*
Diese Attribut-DXL wurde erstellt am 16.11.2011 13:48:36.
*/
// prevent dxl timeout dialog
pragma runLim, 0
Buffer bsz = create
void endAttributeDXL()
{
if (!null obj && attrDXLName != "")
{
obj.attrDXLName = richText tempStringOf(bsz)
}
delete bsz
}
void addNewLineSeparator(Buffer& b)
{
if (length(b) > 0)
{
b += "\n"
}
}
void display(string s)
{
addNewLineSeparator(bsz)
bsz += s
}
void displayRich(string s)
{
addNewLineSeparator(bsz)
bsz += s
}
void displayRichWithColour(string s)
{
addNewLineSeparator(bsz)
bsz += s
}
void displayRichWithColor(string s)
{
addNewLineSeparator(bsz)
bsz += s
}
void display(Attr__ a)
{
string s = richText a
if (!null s)
{
displayRich s
}
}
//**********
// DXL generated by DOORS traceability wizard on 09 November 2011.
// Wizard version 2.0, DOORS version 9.2.0.5
pragma runLim, 0
string limitModules[2] = {"4a3769507c9d1362-00000bcd", "4a3769507c9d1362-00001983"}
string limitVersions[2] = {"", ""}
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showOut(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
if (versionString(otherVersion) != limitVersions[depth-1]) continue
othero = target l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 2)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 2) displayRich("\\pard " " ")
}
if (depth < 2) {
showOut(othero, depth+1)
}
doneOne = true
if (depth == 2) {
s = (identifier othero)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
s = probeRichAttr_(othero,"Object Text", false)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
lines[depth-1] += 2
}
}
showOut(obj,1)
//**********
endAttributeDXL()
if (depth == 2) {
s = (identifier othero)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
s = probeRichAttr_(othero,"Object Text", false)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
MHussaarts - Wed Nov 16 08:02:52 EST 2011 |
Re: Conditionally showing linked Objects using Layout DXL Before any displayRich put something in similar to following:
if(othero."X" "" =="yes") {...} else continue
|
Re: Conditionally showing linked Objects using Layout DXL I think the requirment is to completely ignore an object that has not value "Yes", and if so it seems he should insert your code above the depth check statement: if (probeAttr_(othero, "X") != "Yes") continue if (depth < 2) { ... "probeAttr_" is an installed function that we are not supposed to know about but everybody uses. Its better than <othero."X" ""> because it does error checking, and will return a null string when attr "X" doesn't exist; whereas the straight way will cause a rude DXL abort.
|
Re: Conditionally showing linked Objects using Layout DXL llandale - Wed Nov 16 14:57:48 EST 2011
Thanks for the help, tried it and it works. Super. I wasn't sure were to insert the code (at which displayrich line) and inserted it before the depth-check as suggested by louie. I Whish I had a decent Manual, I understand most of the code but just not 100% of it. Are there by any chance more DXL Manuels, other than the one provided by IBM? The IBM-Manual is like a swiss cheese. |
Re: Conditionally showing linked Objects using Layout DXL MHussaarts - Thu Nov 17 03:14:52 EST 2011 There is some very old "tutorial" out there somewhere and of course IBM has the manual they give you as part of their $$$ DXL course. If you go to the browse tool you can see a lot of small DXL programs. Perhaps you can read the code and also run the program as that may give you a better feel for how things are working; "recognition" is a good learning tool.
|